﻿using System;
using System.IO;

namespace LabSolutions
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = null;
            using (StreamReader sr = new StreamReader("input.txt"))
            {
                input = sr.ReadToEnd();
            }
            string[] inputNumbers = input.Split(' ');
            double x = double.Parse(inputNumbers[0]);
            double y = double.Parse(inputNumbers[1]);
            double z1 = Math.Pow(Math.Cos(x), 4) + Math.Pow(Math.Sin(y), 2) + 1d / 4d * Math.Pow(Math.Sin(2 * x), 2) - 1;
            double z2 = Math.Sin(y + x) * Math.Sin(y - x);
            using (StreamWriter sw = new StreamWriter("output.txt"))
            {
                sw.WriteLine(z1.ToString("0.00000"));
                sw.Write(z2.ToString("0.00000"));
            }            
        }
    }
}
